﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    x:Class="Nok_Air.BookingResult"
    xmlns:local="clr-namespace:Nok_Air"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480" FontFamily="/Nok Air;component/Fonts/Fonts.zip#PSL Display" FontSize="40">

    <phone:PhoneApplicationPage.Resources>
        <LinearGradientBrush x:Key="ItemHeaderBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#00FFE582" Offset="0.9"/>
            <GradientStop Color="White" Offset="0.316"/>
        </LinearGradientBrush>
        <local:DayConverter2 x:Key="DayConverter2"/>
        <local:DepartuerOrReturn x:Key="DepartuerOrReturn"/>
        <local:SellingClsCodeConverter x:Key="SellingClsCodeConverter"/>
        <local:PassengerTypeConverter x:Key="PassengerTypeConverter"/>
        <DataTemplate x:Key="SegmentItemTemplate">
            <StackPanel Orientation="Vertical" Width="440" HorizontalAlignment="Center">
                <StackPanel Background="{StaticResource ItemHeaderBackground}">
                    <TextBlock TextWrapping="Wrap" Text="{Binding RouteNo, Converter={StaticResource DepartuerOrReturn}}" HorizontalAlignment="Center" Foreground="Black"/>
                </StackPanel>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="2.5*"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock TextWrapping="Wrap" Text="{Binding From}" d:LayoutOverrides="Width, Height" Foreground="Black"/>
                    <TextBlock TextWrapping="Wrap" Text="{Binding DepartureAirportName}" Grid.Column="1" Foreground="Black"/>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="2.5*"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock TextWrapping="Wrap" Text="{Binding To}" Foreground="Black"/>
                    <TextBlock TextWrapping="Wrap" Text="{Binding ArrivalAirportName}" Grid.Column="1" Foreground="Black"/>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="2.5*"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock TextWrapping="Wrap" Text="{Binding Date}" Foreground="Black"/>
                    <TextBlock TextWrapping="Wrap" Text="{Binding FlightDate, Converter={StaticResource DayConverter2}}" Grid.Column="1" Foreground="Black"/>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"/>
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                    </Grid.RowDefinitions>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1.2*"/>
                            <ColumnDefinition Width="2*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock TextWrapping="Wrap" Text="{Binding Dep}" Foreground="Black"/>
                        <TextBlock TextWrapping="Wrap" Text="{Binding DepartureTime}" Grid.Column="1" Foreground="Black"/>
                    </Grid>
                    <Grid Grid.Column="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1.2*"/>
                            <ColumnDefinition Width="2*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock TextWrapping="Wrap" Text="{Binding Arr}" Foreground="Black"/>
                        <TextBlock TextWrapping="Wrap" Text="{Binding ArrivalTime}" Grid.Column="1" Foreground="Black"/>
                    </Grid>
                    <Grid Grid.Row="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1.2*"/>
                            <ColumnDefinition Width="2*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock TextWrapping="Wrap" Text="{Binding FlightNo}" Foreground="Black"/>
                        <TextBlock TextWrapping="Wrap" Text="{Binding FlightNumber}" Grid.Column="1" Foreground="Black"/>
                    </Grid>
                    <Grid Grid.Row="1" Grid.Column="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1.2*"/>
                            <ColumnDefinition Width="2*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock TextWrapping="Wrap" Text="{Binding Class}" Foreground="Black"/>
                        <TextBlock TextWrapping="Wrap" Text="{Binding SellingClsCode, Converter={StaticResource SellingClsCodeConverter}}" Grid.Column="1" Foreground="Black"/>
                    </Grid>
                </Grid>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="PassengerItemTemplate">
            <StackPanel Margin="16,0,-1,0" Width="420" d:LayoutOverrides="Height" HorizontalAlignment="Center" >
                <TextBlock Text="{Binding PassengerName}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" FontFamily="/Nok Air;component/Fonts/Fonts.zip#PSL Display" FontWeight="Bold" FontSize="40" Margin="0" VerticalAlignment="Center" Foreground="Black"/>
                <Grid Margin="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="2*"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="{Binding SeatNo}" TextWrapping="Wrap" Margin="0" Style="{StaticResource PhoneTextSubtleStyle}" FontFamily="/Nok Air;component/Fonts/Fonts.zip#PSL Display" FontSize="32.667" FontWeight="Bold" d:LayoutOverrides="Height" Grid.ColumnSpan="2" Foreground="#CC000000"/>
                    <TextBlock Text="{Binding PassCode, Converter={StaticResource PassengerTypeConverter}}" TextWrapping="Wrap" Margin="0" Style="{StaticResource PhoneTextSubtleStyle}" FontFamily="/Nok Air;component/Fonts/Fonts.zip#PSL Display" FontSize="32.667" FontWeight="Bold" d:LayoutOverrides="Height" Grid.ColumnSpan="2" Grid.Column="1" Foreground="#CC000000"/>
                </Grid>
            </StackPanel>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>
    <phone:PhoneApplicationPage.Foreground>
        <SolidColorBrush Color="Black"/>
    </phone:PhoneApplicationPage.Foreground>
    <Grid x:Name="LayoutRoot" Background="Transparent" d:DataContext="{d:DesignData /SampleData/MainViewModelSampleData.xaml}">
        <Grid.RowDefinitions>
            <RowDefinition Height="70"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="80"/>
        </Grid.RowDefinitions>
        <Grid Style="{StaticResource TopAppBarStyle}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition  Width="1*"/>
                <ColumnDefinition  Width="2*"/>
                <ColumnDefinition  Width="1*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Content="Back" HorizontalAlignment="Left"  Width="130" Margin="15,0,0,0" Height="60" Style="{StaticResource BackButtonStyle}" Foreground="White" Visibility="Collapsed" />
            <TextBlock x:Name="Title_checkIn_TextBlock" Margin="0" TextWrapping="Wrap" Text="{Binding ViewBookingTitle}" FontSize="48" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Grid.Column="1"/>
            <Button x:Name="continueButton" Content="{Binding Done}" Style="{StaticResource BlueButtonStyle}" Margin="5,0" Foreground="White" VerticalAlignment="Center" Grid.Column="2" FontSize="40" Click="continueButton_Click" />
        </Grid>
        <Grid Style="{StaticResource ContentStyle}" Margin="0">
            <StackPanel Margin="20" Orientation="Vertical" d:LayoutOverrides="Height">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="2.5*"/>
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel>
                        <TextBlock x:Name="headTitleText" HorizontalAlignment="Left" FontSize="48" FontWeight="Bold" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding ThanksMsg1}"/>
                        <TextBlock x:Name="bookingNumberTextBlock1" Margin="0" TextWrapping="Wrap" Text="{Binding ThanksMsg2}" FontSize="38" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                    </StackPanel>
                    <Image HorizontalAlignment="Center" Grid.Column="1" VerticalAlignment="Center" Source="/ApplicationIconTile.png"/>
                </Grid>
                <ScrollViewer Height="485" Width="440">
                    <StackPanel Orientation="Vertical" Width="440" Background="#7FFFFFFF">
                        <Grid Height="48">
                        	<Grid.Background>
                                <ImageBrush Stretch="UniformToFill" ImageSource="/Images/Button/barbg.jpg">
                        			<ImageBrush.RelativeTransform>
                        				<CompositeTransform CenterY="0.5" CenterX="0.5" TranslateY="-5"/>
                        			</ImageBrush.RelativeTransform>
                        		</ImageBrush>
                        	</Grid.Background>
                    		<StackPanel VerticalAlignment="Center" Orientation="Horizontal" Margin="0" HorizontalAlignment="Center">
                    			<StackPanel.Background>
                    				<ImageBrush/>
                    			</StackPanel.Background>
                    			<TextBlock TextWrapping="Wrap" Text="{Binding BookingItems.BookingNum}" VerticalAlignment="Center" Margin="0,0,5,0" />
                    			<TextBlock TextWrapping="Wrap" Text="{Binding BookingItems.BookNo}" VerticalAlignment="Center" Margin="5,0,0,0" HorizontalAlignment="Center"/>
                    		</StackPanel>
                    	</Grid>
                        <ListBox ItemsSource="{Binding BookingItems.SegmentItem}" ScrollViewer.VerticalScrollBarVisibility="Disabled" Width="440" Margin="0,0,0,0" ItemTemplate="{StaticResource SegmentItemTemplate}"/>
                        <StackPanel Orientation="Vertical">
                            <Grid Margin="0" Background="{StaticResource ItemHeaderBackground}">
                                <TextBlock TextWrapping="Wrap" Text="{Binding Passenger}" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Black"/>
                            </Grid>
                            <ListBox ItemsSource="{Binding BookingItems.PassengerItem}" ScrollViewer.VerticalScrollBarVisibility="Disabled" ItemTemplate="{StaticResource PassengerItemTemplate}"/>
                        </StackPanel>
                        <Grid Margin="0,30,0,0">
                            <Grid.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="White" Offset="0.262"/>
                                    <GradientStop Color="#00FFE582" Offset="0.814"/>
                                </LinearGradientBrush>
                            </Grid.Background>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="1.5*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock TextWrapping="Wrap" Text="{Binding TotalAmount}" d:LayoutOverrides="Height" Grid.ColumnSpan="2" Foreground="Black" Margin="15,0,0,0"/>
                            <StackPanel Grid.ColumnSpan="2" Grid.Column="1" Orientation="Horizontal">
                                <TextBlock TextWrapping="Wrap" Text="{Binding BookingItems.TotalPayment}" d:LayoutOverrides="Height" Foreground="#FFD82525"/>
                                <TextBlock TextWrapping="Wrap" Text="{Binding MoneyUnit}" d:LayoutOverrides="Height" Foreground="#FFD82525" Margin="10,0,0,0"/>
                            </StackPanel>
                        </Grid>
                    </StackPanel>
                </ScrollViewer>
            </StackPanel>
        </Grid>
        <Grid Grid.Row="2">
            <local:AppBarMenuUserControl/>
        </Grid>

        <!--TitlePanel contains the name of the application and page title-->

        <!--ContentPanel - place additional content here-->
    </Grid>

</phone:PhoneApplicationPage>
